""==getCookie("userna")?(alert("你还没有登录"),$(window).attr("location","register.html")):$.get("goodsAndShoppingCart/getShoppingCart.php",{vipName:getCookie("userna")},function(t){let e=JSON.parse(t),n="";function o(){let t=0;$(".xiaoji").each(function(){$(this).parents("tr").find(".checked").prop("checked")&&(t+=parseFloat($(this).html())),console.log(t),$(".total-price").html(t)})}function a(){let e=0;for(let t=0;t<$(".checked").length;t++){var n;console.log(5),1==$(".checked")[t].checked&&(console.log(11111),n=$(".checked").parent().parent().next().next().next().next().children().children().next().html(),console.log(n),e+=parseInt(n),console.log(e))}$("#count-all").html(e)}e.forEach((t,e)=>{n+=`
            <tr>
                    <td class="t-l" width="188"><input type="checkbox" id="select-0" value="1"
                            checked="" name="sex" data-skusn="K21101264804_1" data-count="1"
                            data-price="4799" style="display: none;">
                        <label  class="checkboxCol">
                            <input type="checkbox" name="" id="inpaa" class="checked">
                            <img src="${t.goodsImg}" alt="">
                        </label>
                    </td>
                    <td width="70">
                    </td>
                    <td width="246">
                        <p class="pro-name">${t.goodsName}</p>
                    </td>
                    <td width="134" class="danjia" >${t.goodsPrice}</td>
                    <td width="134" class="sel">
                        <div class="sel-num">
                            <button class="reduce-num" id="reduce0">-</button>
                            <i class="num">1</i>
                            <button class="add-num" id="add0">+</button>
                        </div>
                    </td>

                    <td width="134"  class="xiaoji">${t.goodsPrice}</td>
                    <td width="134">
                        <span class="delbb" goodsId="${t.goodsId}">删除</span>
                        <span>收藏</span>
                    </td>
            </tr>`}),$("tbody").html(n),$(".delbb").click(function(){console.log($(this)),console.log(getCookie("userna")),""!=getCookie("userna")&&($.get("goodsAndShoppingCart/deleteGoods.php",{vipName:getCookie("userna"),goodsId:$(this).attr("goodsId")},function(t){}),$(this).parent().parent().remove())}),$(".checkboxCol").click(function(){$(this).parents("table").find("tbody").find("input[type='checkbox']").attr({checked:$(this).find("input").prop("checked")}),o(),a()}),$(".add-num").each(function(){$(this).click(function(){var t=parseFloat($(this).prev().html());t++,$(this).prev().html(t),t=parseFloat($(this).parent().parent().prev().html())*t,$(this).parent().parent().next().html(t),o(),a()})}),$(".reduce-num").each(function(){$(this).click(function(){var t=parseFloat($(this).next().html());t<=1||(t--,$(this).next().html(t),t=parseFloat($(this).parent().parent().prev().html())*t,$(this).parent().parent().next().html(t),o(),a())})})});